<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>couchdbkit.schema.base.DocumentBase</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="couchdbkit-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="couchdbkit-module.html">Package&nbsp;couchdbkit</a> ::
        <a href="couchdbkit.schema-module.html">Package&nbsp;schema</a> ::
        <a href="couchdbkit.schema.base-module.html">Module&nbsp;base</a> ::
        Class&nbsp;DocumentBase
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="couchdbkit.schema.base.DocumentBase-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class DocumentBase</h1><p class="nomargin-top"><span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase">source&nbsp;code</a></span></p>
<pre class="base-tree">
    object --+    
             |    
<a href="couchdbkit.schema.base.DocumentSchema-class.html">DocumentSchema</a> --+
                 |
                <strong class="uidshort">DocumentBase</strong>
</pre>

<dl><dt>Known Subclasses:</dt>
<dd>
      <ul class="subclass-list">
<li><a href="couchdbkit.schema.base.Document-class.html">Document</a></li>  </ul>
</dd></dl>

<hr />
<pre class="literalblock">
Base Document object that map a CouchDB Document.
It allow you to statically map a document by
providing fields like you do with any ORM or
dynamically. Ie unknown fields are loaded as
object property that you can edit, datetime in
iso3339 format are automatically translated in
python types (date, time &amp; datetime) and decimal too.

Example of documentass

.. code-block:: python

    from couchdbkit.schema import *
    class MyDocument(Document):
        mystring = StringProperty()
        myotherstring = unicode() # just use python types


Document fields can be accessed as property or
key of dict. These are similar : ``value = instance.key or value = instance['key'].``

To delete a property simply do ``del instance[key'] or delattr(instance, key)``

</pre>

<!-- ==================== NESTED CLASSES ==================== -->
<a name="section-NestedClasses"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Nested Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-NestedClasses"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="couchdbkit.schema.base.DocumentSchema-class.html">DocumentSchema</a></code></b>:
      <code><a href="couchdbkit.schema.base.SchemaProperties-class.html">__metaclass__</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="couchdbkit.schema.base.DocumentBase-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">_d</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">**kwargs</span>)</span><br />
      x.__init__(...) initializes x; see help(type(x)) for signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="save"></a><span class="summary-sig-name">save</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">**params</span>)</span><br />
      Save document in database.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.save">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="store"></a><span class="summary-sig-name">store</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">**params</span>)</span><br />
      Save document in database.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.save">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="delete"></a><span class="summary-sig-name">delete</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Delete document from the database.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.delete">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="couchdbkit.schema.base.DocumentSchema-class.html">DocumentSchema</a></code></b>:
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__contains__">__contains__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__delattr__">__delattr__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__delitem__">__delitem__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__getattr__">__getattr__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__getitem__">__getitem__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__getstate__">__getstate__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__iter__">__iter__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__len__">__len__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__setattr__">__setattr__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#__setitem__">__setitem__</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#all_properties">all_properties</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#clone">clone</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#dynamic_properties">dynamic_properties</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#items">items</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#iteritems">iteritems</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#to_json">to_json</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#validate">validate</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS METHODS ==================== -->
<a name="section-ClassMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="set_db"></a><span class="summary-sig-name">set_db</span>(<span class="summary-sig-arg">cls</span>,
        <span class="summary-sig-arg">db</span>)</span><br />
      Set document db</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.set_db">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_db"></a><span class="summary-sig-name">get_db</span>(<span class="summary-sig-arg">cls</span>)</span><br />
      get document db</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.get_db">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="couchdbkit.schema.base.DocumentBase-class.html#save_docs" class="summary-sig-name">save_docs</a>(<span class="summary-sig-arg">cls</span>,
        <span class="summary-sig-arg">docs</span>,
        <span class="summary-sig-arg">use_uuids</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">all_or_nothing</span>=<span class="summary-sig-default">False</span>)</span><br />
      Save multiple documents in database.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.save_docs">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="couchdbkit.schema.base.DocumentBase-class.html#bulk_save" class="summary-sig-name">bulk_save</a>(<span class="summary-sig-arg">cls</span>,
        <span class="summary-sig-arg">docs</span>,
        <span class="summary-sig-arg">use_uuids</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">all_or_nothing</span>=<span class="summary-sig-default">False</span>)</span><br />
      Save multiple documents in database.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.save_docs">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get"></a><span class="summary-sig-name">get</span>(<span class="summary-sig-arg">cls</span>,
        <span class="summary-sig-arg">docid</span>,
        <span class="summary-sig-arg">rev</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">db</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">dynamic_properties</span>=<span class="summary-sig-default">True</span>)</span><br />
      get document with `docid`</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.get">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_or_create"></a><span class="summary-sig-name">get_or_create</span>(<span class="summary-sig-arg">cls</span>,
        <span class="summary-sig-arg">docid</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">db</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">dynamic_properties</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">**params</span>)</span><br />
      get  or create document with `docid`</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.get_or_create">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="couchdbkit.schema.base.DocumentSchema-class.html">DocumentSchema</a></code></b>:
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#build">build</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#from_json">from_json</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#properties">properties</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#wrap">wrap</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="_db"></a><span class="summary-name">_db</span> = <code title="None">None</code><br />
      hash(x)
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="_doc_type"></a><span class="summary-name">_doc_type</span> = <code title="'DocumentBase'"><code class="variable-quote">'</code><code class="variable-string">DocumentBase</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="couchdbkit.schema.base.DocumentSchema-class.html">DocumentSchema</a></code></b> (private):
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#_allow_dynamic_properties" onclick="show_private();">_allow_dynamic_properties</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#_doc" onclick="show_private();">_doc</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#_doc_type_attr" onclick="show_private();">_doc_type_attr</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#_dynamic_properties" onclick="show_private();">_dynamic_properties</a></code>,
      <code><a href="couchdbkit.schema.base.DocumentSchema-class.html#_properties" onclick="show_private();">_properties</a></code>
      </p></div>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="couchdbkit.schema.base.DocumentBase-class.html#new_document" class="summary-name">new_document</a>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">_d</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">**kwargs</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>x.__init__(...) initializes x; see help(type(x)) for signature</p>
  <dl class="fields">
    <dt>Overrides:
        object.__init__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="save_docs"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">save_docs</span>(<span class="sig-arg">cls</span>,
        <span class="sig-arg">docs</span>,
        <span class="sig-arg">use_uuids</span>=<span class="sig-default">True</span>,
        <span class="sig-arg">all_or_nothing</span>=<span class="sig-default">False</span>)</span>
    <br /><em class="fname">Class Method</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.save_docs">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Save multiple documents in database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>use_uuids</code></strong> - add _id in doc who don't have it already set.</li>
        <li><strong class="pname"><code>all_or_nothing</code></strong> - In the case of a power failure, when the database restarts either
          all the changes will have been saved or none of them. However, it
          does not do conflict checking, so the documents will be committed
          even if this creates conflicts.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="bulk_save"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">bulk_save</span>(<span class="sig-arg">cls</span>,
        <span class="sig-arg">docs</span>,
        <span class="sig-arg">use_uuids</span>=<span class="sig-default">True</span>,
        <span class="sig-arg">all_or_nothing</span>=<span class="sig-default">False</span>)</span>
    <br /><em class="fname">Class Method</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="couchdbkit.schema.base-pysrc.html#DocumentBase.save_docs">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Save multiple documents in database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>use_uuids</code></strong> - add _id in doc who don't have it already set.</li>
        <li><strong class="pname"><code>all_or_nothing</code></strong> - In the case of a power failure, when the database restarts either
          all the changes will have been saved or none of them. However, it
          does not do conflict checking, so the documents will be committed
          even if this creates conflicts.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== PROPERTY DETAILS ==================== -->
<a name="section-PropertyDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Property Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-PropertyDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="new_document"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">new_document</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><i>unreachable</i>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="couchdbkit-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Fri May  4 11:48:41 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
